#!/bin/bash
#
# This scipt is intended to be quite quiet when it succeeds,
# printing only the test name and "Passed". 
# If the test fails then the whole log is printed, hopefully
# helping diagnose where the problem lies.
#

#requires not make

echo ""
echo "Running FieldGroup test"

# Ensure we clean old run, in case it succeeded last time
make clean

# This test should fail to compile
make > run.log 2>&1

if [ $? -eq 0 ]; then
  # Compiled ok, something wrong
  # Send the run.log file to stdout so it's stored in Travis logs
  echo "Fail. Log follows:"
  echo ""
  cat run.log
  exit 1;
fi

echo "Passed"
exit 0
